Retrieves the position and size of a control relative to it's window.
ControlGetPos ( "title", "text", controlID )
Parameters
title | The title of the window to access. |
text | The text of the window to access. |
controlID | The control to interact with. See Controls. |
Return Value
Success: | Returns an array containing the size and the control's position relative to it's client window: |
$array[0] = X position | |
$array[1] = Y position | |
$array[2] = Width | |
$array[3] = Height | |
Failure: | Sets @error to 1. |
Remarks
The title/text is referencing the parent window, so be careful with "","" which references the active window which may not be the one containing the controlID control.
Related
ControlCommand, ControlMove, WinMove
Example
$pos = ControlGetPos("Untitled - Notepad", "", "Edit1")
MsgBox(0, "Window Stats:", "POS: " & $pos[0] & "," & $pos[1] & " SIZE: " & $pos[2] & "," & $pos[3] )